from selenium.webdriver.common.by import By
from Page.Page import Page

class Page2(Page):
    # /html/body/div[3]/div[2]/ul/li[1]/a
    shouy_loc = (By.XPATH,'/html/body/div[3]/div[2]/ul/li[1]/a')
    def shouy(self):
        self.click(self.shouy_loc)

    # class="search-input"
    search_loc = (By.CLASS_NAME,'search-input')
    def search(self):
        self.send_keys(self.search_loc,'钻石项链')

    # //*[@id="searchForm"]/div[2]/input
    searchbtn_loc = (By.XPATH,'//*[@id="searchForm"]/div[2]/input')
    def searchbtn(self):
        self.click(self.searchbtn_loc)

    # /html/body/div[5]/div[2]/div[2]/div[1]/ul/li/div[1]/span/a/img
    img_loc = (By.XPATH,'/html/body/div[5]/div[2]/div[2]/div[1]/ul/li/div[1]/span/a/img')
    def img(self):
        self.click(self.img_loc)

    # /html/body/div[4]/a[3]
    dy3_loc = (By.XPATH,'/html/body/div[4]/a[3]')
    def dy3(self):
        return self.text(self.dy3_loc)

    # id="buy-cart"
    buy_loc = (By.ID,'buy-cart')
    def buy(self):
        self.click(self.buy_loc)

    # id="address-41"
    address_loc = (By.ID,'address-41')
    def address(self):
        self.click(self.address_loc)

    # id="order-button"
    next_loc = (By.ID,'order-button')
    def next(self):
        self.click(self.next_loc)